import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs';
import { FormControl } from '@angular/forms';
import 'rxjs/Rx';
@Component({
  selector: 'app-ober',
  templateUrl: './ober.component.html',
  styleUrls: ['./ober.component.css']
})
export class OberComponent implements OnInit {

  InputSearch:FormControl = new FormControl();

  //创建一个当前时间
  birthday:Date = new Date();
  //数字类型
  numberData:number = 15.152386;
  constructor() {
    //原生的观察者示例
    // Observable.from([1,2,3,4])
    // .filter( e => e%2 == 0)
    // .map( e => e*e )
    // .subscribe(
    //   e =>console.log(e)
    // )
    this.InputSearch.valueChanges
      .debounceTime(500)
      .subscribe( e => {console.log(e)} )

  }

  ngOnInit() {
  }

  onKeyUp(value:string){
    console.log(value)
  }

}
